<template>
    <div>
        <listText :title="'姓名'" :itemVal="infoSource.name"></listText>
        <listText :title="'性别'" :itemVal="infoSource.sex"></listText>
        <listText :title="'证件号码'" :itemVal="infoSource.id_card"></listText>
        <!-- <listText :title="'出生日期'" :itemVal="infoSource.industry"></listText> -->
        <listText :title="'电话号码'" :itemVal="infoSource.mobile"></listText>

        <listText :title="'通讯地址'" :itemVal="infoSource.address"></listText>
        <listText :title="'前置学历'" :itemVal="infoSource.education"></listText>
        <listText :title="'所属业务员'" :itemVal="infoSource.salesman_text"></listText>
        <listText :title="'是否有佣金'" :itemVal="infoSource.is_brokerage==1?'是':'否'"></listText>
        <listText :title="'佣金金额'" :itemVal="infoSource.brokerage"></listText>
        <listText :title="'特殊备注'" :itemVal="infoSource.remark"></listText>
        <listText :title="'合作机会'" :itemVal="infoSource.cooperation"></listText>
        <div class="link-btn">
            <router-link tag="div" to="/jyEditor?type=2">信息编辑</router-link>
            <router-link tag="div" to="/jyProdectConfig?type=2">产品配置</router-link>
            <router-link tag="div" to="/jyConfigHistory?type=2">产品配置记录</router-link>
        </div>
    </div>
</template>

<script>
    import listText from '@/components/listText.vue'

    export default {
        name: "finance",
        components: {listText},
        data() {
            return {
                infoSource: {},
            }
        },
        methods: {
            getInfo() {
                let params = {
                    wx_member_id: localStorage.getItem('wx_member_id'),
                    token: localStorage.getItem('token'),
                    cate_id: 2,
                };
                this.$post("/api/member/read", params)
                    .then(res => {
                        if (res.code == 1) {
                            this.infoSource = res.data
                            this.site = this.infoSource.province + this.infoSource.area + this.infoSource.address

                            if (!this.infoSource.province) {
                                this.infoSource.province = ''
                            }
                            if (!this.infoSource.area) {
                                this.infoSource.area = ''
                            }
                            if (!this.infoSource.address) {
                                this.infoSource.address = ''
                            }
                        }
                    })
                    .catch(err => {
                    });
            },
        },
        created() {
            this.getInfo()
        }
    }
</script>

<style lang="less" scoped>
    .link-btn {
        display: flex;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;

        div {
            width: 45vw;
            height: 34px;
            border-radius: 4px;
            background: #366cb3;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            margin: 4px;
            font-size: 12px;
        }
    }
</style>